package com.warren.web.dao.common;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

public abstract class MyBatisDao {

	private SqlSessionFactory sqlSessionFactory;
	
	@Resource
	public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
		this.sqlSessionFactory = sqlSessionFactory;
	}
	
	protected SqlSession getSqlSession() {
		return sqlSessionFactory.openSession();
	}
	
}
